import service from '../utils/request'

// 获取用户信息
export const getUserInfo = () => {
  return service({
    url: '/sysUser/info',
    method: 'get'
  })
}

// 更新用户信息
export const updateUserInfo = (data) => {
  return service({
    url: '/user/info',
    method: 'put',
    data
  })
}

// 上传头像
export const uploadAvatar = (data) => {
  return service({
    url: '/sysUser/avatar',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 修改密码
export const changePassword = (data) => {
  return service({
    url: '/user/password',
    method: 'put',
    data
  })
}
